package com.happy_hao.topbiz.dto;

import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.Pattern;
import lombok.Data;

@Data
public class EmailCodeRequest {

    @NotBlank(message = "邮箱不能为空")
    @Pattern(regexp = "^(?![_.-])[a-zA-Z0-9_.+-]+(?<![_.-])@[a-zA-Z0-9-]+\\.[a-zA-Z0-9-.]{2,}$", message = "邮箱格式不合法")
    private String email;

    @NotBlank(message = "验证码不能为空")
    @Pattern(regexp = "^\\d{6}$", message = "必须是6位数字验证码")
    private String code;
}
